<style>
.layui-input-block{
margin-left:120px;
}
</style>
<!-- start form -->
<form class="layui-form" action="" id="orderEditForm">
<div class="layui-row"  style="margin-top:10px;">
	<input  name ="id" class="layui-input" id="id"  type="hidden" value="">
	 <div class="layui-form-item">
	     	<label class="layui-form-label"style="width:120px;">公司名：</label>
	    	<div class="layui-input-block" style="width:200px;">
	    		 <select  id="companyId" name="companyId" lay-verify="required" >
						<option th:each="ec:${actCenterCompanyMap}" th:attr="value=${ec.id}" th:text="${ec.name}" ></option>
	      		</select>	
	         </div>
    </div>
    <div class="layui-form-item">
             <label class="layui-form-label" style="width:120px;">部门编号：</label>
             <div class="layui-input-block" style="width:200px;">
                 <input type="text" class="layui-input" name="no" lay-verify="required" >
             </div>
     </div>
     <div class="layui-form-item">
         <label class="layui-form-label" style="width:120px;">部门名称：</label>
         <div class="layui-input-block" style="width:200px;">
             <input type="text" class="layui-input" name="name" lay-verify="required" > 
     	 </div>
      </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width:120px;">备注：</label>
       	<div class="layui-input-block" style="width:200px;">
            <textarea class="layui-textarea"   style="min-height: 50px;" name="comment" class="layui-input" name="remark"></textarea>
   		</div>
    </div>
</div>
 <div class="layui-row" style="margin-top:20px;">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="text-align:center;">
          <button class="layui-btn" lay-submit="" lay-filter="formSubmit" authcode="900019">提交</button>
      	<button type="button" class="layui-btn layui-btn-primary" id="closeBtn">关闭</button>
    </div>
  </div>
</form>
<!-- end form -->
<script>
layui.use('form', function(){
	 var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
	 form.render();
	 //监听表单提交
	 form.on('submit(formSubmit)',function(data) {
	 $.ajax({url:'/com/department/add',
			data:$("#orderEditForm").serializeJson(),
			type:"get",
			contentType:"application/json",
			success:function(data){
				if(data.code==200){
					layer.msg("数据保存成功！");
					layer.closeAll();
				}else{
					layer.msg(data.message);
				}
			}});
		return false;
	 });
	 //关闭
	 $('#closeBtn').click(function() {
			layer.close(editdialogindex);
		});
});
</script>